# -*-coding:utf-8 -*-
#
# Created on 2019/6/11, by felix
#

from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.models import AbstractUser  # 也是基表


# 1、基表
# 基表只是提供公有字段，不生成表
class BaseModel(models.Model):
    is_deleted = models.BooleanField(default=False, db_index=True, verbose_name="是否删除")  # 默认不是删除，数据库中是0/1
    created_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    updated_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        abstract = True  # abstract=True 来声明基表，作为model不能再数据库中形成对应的表
